﻿using MediatR;
using T.Personnel.API.Application.Command.ManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.API.Application.CommandHandler.ManageHandler
{
    public class AddEntryManageHandler : IRequestHandler<AddEntryManageCommand, int>
    {
        private readonly IManageRepository manageRepository;

        public AddEntryManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<int> Handle(AddEntryManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.AddEntryAsync(request);
        }
    }
}
